﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.quest.Display {
    import flash.events.*;
    import Events.*;
    import flash.utils.*;
    import Display.DialogUI.*;
    import org.aswing.*;
    import Classes.*;
    import flash.text.*;
    import org.aswing.event.*;
    import org.aswing.border.*;
    import Display.aswingui.*;
    import L10n.*;

    public class CityNameDialogView extends InputTextDialogView {

        public var m_textKey:String;

        public function CityNameDialogView(_arg1:Dictionary, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:int=0, _arg7:Function=null, _arg8:String="", _arg9:int=0){
            super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9);
        }
        override protected function onAccept(_arg1:AWEvent):void{
            dispatchEvent(new GenericPopupEvent(GenericPopupEvent.SELECTED, YES, true));
            if (m_closeCallback != null){
                removeEventListener(GenericPopupEvent.SELECTED, m_closeCallback);
            };
            closeMe();
        }
        override protected function createTextAreaInnerPane(_arg1:Component):JPanel{
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            _local2.append(_arg1);
            var _local3:JTextField = super.createTextField();
            var _local4:Component = createTextFieldContainer(_local3);
            var _local5:JPanel = this.createCityNameTextComponent();
            _local3.addEventListener(TextEvent.TEXT_INPUT, textInput);
            m_textField = _local3;
            _local2.append(ASwingHelper.verticalStrut(10));
            _local2.append(_local5);
            _local2.append(ASwingHelper.verticalStrut(5));
            _local2.append(_local4);
            _local2.append(ASwingHelper.verticalStrut(9));
            return (_local2);
        }
        protected function createCityNameTextComponent():JPanel{
            var _local1:JPanel = new JPanel(new BorderLayout());
            var _local2:String = ZLoc.t("Dialogs", "CongratsPlayer", {userName:Global.player.firstName});
            var _local3:String = ZLoc.t("Dialogs", "NameTownInstruction");
            var _local4:Component = ASwingHelper.makeMultilineText(_local2, 380, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.CENTER, 16, 10582366);
            LocaleHelper.localSetting.TextField_adjust(((_local4 as AssetPane).getAsset() as TextField), {
                embedFonts:false,
                font:EmbeddedArt.SYSTEM_FONT
            });
            _local4.setBorder(new EmptyBorder(null, new Insets(0, 20, 0, 20)));
            var _local5:Component = ASwingHelper.makeMultilineText(_local3, 380, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.CENTER, 14, 10582366);
            _local5.setBorder(new EmptyBorder(null, new Insets(20, 20, 0, 20)));
            _local1.append(_local4);
            _local1.append(ASwingHelper.verticalStrut(30));
            _local1.append(_local5);
            return (_local1);
        }

    }
}//package Modules.quest.Display 
